<?php require_once('../../core/import.php');?>
<?php User::Permission('SUPPLY_UPDATE'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <script type="text/javascript" src="../../scripts/import.js"></script>
    <script type="text/javascript" src="../../scripts/components/kindeditor/import.kindeditor.js"></script>
	<script type="text/javascript" src="../../../scripts/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="scripts/edit.js"></script>
    <script type="text/javascript">
    	function FreightPayer(){
		var Plyer=document.getElementById("Freight_Payer").value;
			if(Plyer=='BUYYER'){
				document.getElementById("ContentContainer_Freight").style.display="";
			}else{
				document.getElementById("ContentContainer_Freight").style.display="none";	
			}
		}

    </script>
</head>

<body>
	<?php
	    #赋值检测
	    if(!is_numeric($ID=Functions::UrlArgs('id'))) exit('信息ID不正确');
	    
	    #获取数据
	    $Data=DB::GetRowByID('supply',$ID);
	    {
	?>
    <form id="Form1" name="Form1" method="post" enctype="multipart/form-data" action="edit.action.php" class="Form">
        <fieldset>
             <legend>供应信息修改</legend>
            <table width="100%" cellpadding="1" cellspacing="0">
            <tr>
  		  <td colspan="2" align="right"><font color="red">（*）为必填写项</font> </td>
		</tr>
            <tr>
             	<td height="25" align="left" valign="middle"><font color="red">* </font>账户：</td>
            	<td colspan="2">
                  	<input type="text" name="Account" id="Account" value="<?php echo $Data['Account'] ?>" class="input350" readonly="readonly"/>
                  </td>
            </tr>
            <tr>
                <td width="130" height="25" align="left"><font color="red">* </font>类别：</td>
                <td width="915" colspan="2">
                  <select name="ClassID" id="ClassID"  class="input105" >
                    <option value="none">-- 请选择 --</option>
                    </select>
                    -
                    <select name="SubclassID" id="SubclassID" class="input105">
                    <option value="none">-- 请选择 --</option>
                  </select>
                    <input type="hidden" id="ClassID_Old" name="ClassID_Old" value="<?php echo $Data['ClassID'] ?>" />
                <input type="hidden" id="SubclassID_Old" name="SubclassID_Old" value="<?php echo $Data['SubclassID'] ?>" /></td>
            </tr>
            <tr>
             	<td height="25" align="left" valign="middle"><font color="red">* </font>标题：</td>
            	<td colspan="2">
                  	<input type="text" name="Title" id="Title" value="<?php echo $Data['Title'] ?>" class="input350"   />
                  </td>
            </tr>
            <tr>
             	<td height="25" align="left" valign="middle">规格：</td>
            	<td colspan="2">
                	  	<input type="text" name="Norms" id="Norms" value="<?php echo $Data['Norms'] ?>" class="input105" />
                  </td>
            </tr>
            
            <tr>
                <td align="left">产地：</td>
                <td>
                  	<input type="text" name="Origin" id="Origin" value="<?php echo $Data['Origin'] ?>" class="input105" />
                </td>
            </tr>
            <tr>
                <td align="left">品牌：</td>
                <td>
                  	<input type="text" name="Brand" id="Brand" value="<?php echo $Data['Brand'] ?>" style="width:175px"  />
                </td>
            </tr>
            <tr>
                <td align="left">缩略图：</td>
                <td>
                    	<input type="file" name="ThumbnailPath" id="ThumbnailPath" value="<?php $Data['ThumbnailPath'] ?>" style="width:180px" />
                <?php if($Data['ThumbnailPath']){?>
                <a href="<?php echo Config::PATH_RELATIVE_ATTACHMENT_SUPPLY.'/'.$Data['ThumbnailPath']; ?>" target="_blank">点击查看</a>
                <?php } ?>
                </td>
            </tr>
            <tr>
            	<td height="25" align="left" valign="top">描述：</td>
            	<td colspan="2">
                  	<textarea id="Description" name="Description"  style="width:80%; height:300px;"><?php echo $Data['Description'] ?></textarea>
                  </td>
            </tr>
            <tr>
                <td align="left"><font color="red">* </font>单价：</td>
                <td>
                  	<input type="text" name="Price" id="Price" value="<?php echo $Data['Price'] ?>" class="input55" />
                </td>
            </tr>
            <tr>
                <td align="left"><font color="red">* </font>单位：</td>
                <td>
                  	<input type="text" name="Unit" id="Unit" value="<?php echo $Data['Unit'] ?>" class="input55" />
                </td>
            </tr>
            <tr>
                <td align="left"><font color="red">* </font>起订量：</td>
                <td>
                  	<input type="text" name="MOQ" id="MOQ" value="<?php echo $Data['MOQ'] ?>" class="input55" />
                </td>
            </tr>
            <tr>
                <td align="left"><font color="red">* </font>库存：</td>
                <td>
                  	<input type="text" name="Inventory" id="Inventory" value="<?php echo $Data['Inventory'] ?>" class="input55" />
                </td>
            </tr>
            <tr>
                <td align="left"><font color="red">* </font>运费承担：</td>
                <td>
                    <select name="Freight_Payer" id="Freight_Payer"  class="input105" onchange="FreightPayer();">
                        <option value="none">-- 请选择 --</option>
                        <option value="SELLER" <?php if($Data['Freight_Payer']=='SELLER'){?> selected="selected" <?php }?>>卖家</option>
                        <option value="BUYYER" <?php if($Data['Freight_Payer']=='BUYYER'){?> selected="selected" <?php }?>>买家</option>
                    </select>
                </td>
            </tr>
            <tr id="ContentContainer_Freight" style="display:<?php if($Data['Freight_Payer']!='BUYYER') {?>none<?php }?>;">
                <td align="left">运费：</td>
                <td>
                    <input name="Freight" type="text" id="Freight" value="<?php echo $Data['Freight'] ?>" class="input105" />
                  </td>
            </tr>
         </table>
        </fieldset>
        <fieldset>  
          <legend>设置</legend>
            <table width="100%" cellpadding="1" cellspacing="0">
                  <tr>
                      <td width="14%" align="left">是否加入产品超市：</td>
                      <td width="86%">
                          <input type="radio" name="M_Supermarket_Is" value="1" <?php if($Data['M_Supermarket_Is']==1){ echo 'checked' ;}?>/> 是&nbsp;
	  			  <input type="radio" name="M_Supermarket_Is" value="0" <?php if($Data['M_Supermarket_Is']==0){ echo 'checked' ;}?>/> 否 
                      </td>
                  </tr>
                  <tr>
                      <td align="left">产品超市是否置顶：</td>
                      <td>
                          <input type="radio" name="M_Supermarket_Top_Is" value="1" <?php if($Data['M_Supermarket_Top_Is']==1){ echo 'checked' ;}?>/> 是&nbsp;
	  			  <input type="radio" name="M_Supermarket_Top_Is" value="0" <?php if($Data['M_Supermarket_Top_Is']==0){ echo 'checked' ;}?>/> 否 
                      </td>
                  </tr>
                  <tr>
                  <td align="left">是否精品推荐：</td>
                  <td>
                  	<input type="radio" name="M_Recommend_Is" value="1" <?php if($Data['M_Recommend_Is']==1){ echo 'checked' ;}?>/>是&nbsp;
					<input type="radio" name="M_Recommend_Is" value="0" <?php if($Data['M_Recommend_Is']==0){ echo 'checked' ;}?>/>否 
                    </td>
                  </tr>
            </table>
        </fieldset>  
        <input type="hidden" name="ID" value="<?php echo $ID; ?>" />
        <input id="ActionButton" name="ActionButton" type="submit" value="确定" class="button" /> 
        <input id="ResetButton" name="ResetButton" type="reset" value="重置" class="button" />
    </form>
     <?php	
	    }
	    $Data=NULL;
	?>
</body>
</html>